/*
 * @Author:
 * @Date: 2022-11-24 13:56:00
 * @LastEditors:
 * @LastEditTime: 2023-03-08 16:08:04
 * @FilePath: \immoka-admin\src\api\personalizedMall\commodity.js
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name} , All Rights Reserved.
 */
import request from "@/utils/request";

export function getData(params) {
  return request({
    url: "/mall/product/list",
    method: "get",
    params
  });
}
// 获取风格标签
export function getStyleData() {
  return request({
    url: "/mall/product-style/allShow",
    method: "get"
  });
}
// 获取全部分类
export function getCateData() {
  return request({
    url: "/mall/product-cate/of-all",
    method: "get"
  });
}

// 获取商品详情
export function getDetailData(id) {
  return request({
    url: "/mall/product/detail",
    method: "get",
    params: { id }
  });
}

// 添加商品
export function postData(data) {
  return request({
    url: "/mall/product/add",
    method: "post",
    data
  });
}

// 编辑商品
export function postEditData(data) {
  return request({
    url: "/mall/product/edit",
    method: "put",
    data
  });
}

// 删除
export function deleteData(ids) {
  return request({
    url: "/mall/product/del",
    method: "delete",
    data: { ids }
  });
}

// 赠送
export function postSendData(data) {
  return request({
    url: "/mall/product/give",
    method: "post",
    data
  });
}

// 编辑新增接口装扮
export function productEdit(data) {
  return request({
    url: "/mall/product/edit",
    method: "put",
    data
  });
}

// /mall/product/add
export function productAdd(data) {
  return request({
    url: "/mall/product/add",
    method: "post",
    data
  });
}
